home *** CD-ROM | disk | FTP | other *** search
/ MacHack 2000 / MacHack 2000.toast / pc / The Hacks / Softshoe / Lisa's Mac Parts / Views / Tiled Views / PaneColumnOfHeight.h < prev    next >
Text File  |  2000-06-23  |  697b  |  40 lines

  1. // PaneColumnOfHeight.h
  2.  
  3. #ifndef PaneColumnOfHeight_h
  4. #define PaneColumnOfHeight_h
  5.  
  6. #ifndef PaneColumn_h
  7. #include "PaneColumn.h"
  8. #endif
  9. #ifndef TiledPane_h
  10. #include "TiledPane.h"
  11. #endif
  12.  
  13. template <uint32 numberOfPanes>
  14. class PaneColumnOfHeight: public PaneColumn
  15.   {
  16.     private:
  17.         TiledPane basePanes[ numberOfPanes ];
  18.     
  19.     public:
  20.         PaneColumnOfHeight()
  21.           {
  22.             for ( uint32 i = 0; i < numberOfPanes; i++ )
  23.                 Add( basePanes[i], afterEnd );
  24.           }
  25.         
  26.         RectangularPane& operator[]( uint32 i )
  27.           {
  28.             Assert( i < numberOfPanes );
  29.             return basePanes[i];
  30.           }
  31.         
  32.         const RectangularPane& operator[]( uint32 i ) const
  33.           {
  34.             Assert( i < numberOfPanes );
  35.             return basePanes[i];
  36.           }
  37.   };
  38.  
  39. #endif
  40.